//
//  NSObject+Request.h
//  TooToo
//
//  Created by liuning on 15/12/29.
//  Copyright © 2015年 MoHao. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSObject (Request)

-(void)get:(NSString*)urlString code:(NSInteger)code;
-(void)post:(NSString*)urlString param:(NSDictionary*)param code:(NSInteger)code;

-(void)getDataByUrl:(NSString *)urlString code:(NSInteger)code;
-(void)getDataByUrl:(NSString *)urlString success:(void(^)(NSData * data))success failure:(void(^)(NSError *error))failure;
-(void)postDataByUrl:(NSString *)urlString param:(NSDictionary*)param code:(NSInteger)code;

-(void)requestSuccess:(id)data code:(NSInteger)code;
-(void)requestLogicError:(id)data code:(NSInteger)code;
-(void)requestData:(NSData *)data code:(NSInteger)code;
-(void)requestFailure:(NSError *)error code:(NSInteger)code;

@end
